﻿#include<iostream>
using namespace std;
int main() {
	int a[5];
	int* ptrA{ a + 1 };

	a[0] = 0;
	a[1] = 1;
	a[2] = 2;

	cout << ptrA[0] << endl;

	int test[2][5]{
	{1001,1002,1003,1004,1005},
	{2001,2002,2003,2004,2005}
	};

	int* ptestA[5];//五个int类型的指针(数组指针)
	int* ptest1{ (int*)test };//多维数组转一维数组
	int(*ptest)[5] {test};//数组指针，5代表有5个元素位置

	cout << test[1][4] << endl;//2005
	cout << ptest1[9] << endl;//2005
	cout << ptest[1][4] << endl;//2005

	ptest = ptest + 1;//这里+1的值是数据类型的大小5*int

	cout << sizeof(ptest1) << endl;
	cout << sizeof(ptest) << endl;
}